package com.ict.web.controller.yzq;




import com.ict.common.core.controller.BaseController;
import com.ict.common.core.page.TableDataInfo;
import com.ict.web.dto.ExtractMonitoringAllDto;
import com.ict.web.dto.QueryExpertExtractMonitorDto;
import com.ict.web.service.ExtractMonitoringService;
import com.ict.web.vo.ExpertExtractionMonitorListVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.List;

/**
 * 抽取监控Controller
 *
 * @author xc
 * @date 2022-04-27
 */
@Api(tags = "抽取监控")
@RestController
@RequestMapping("/monitoring")
public class ExtractMonitoringController extends BaseController
{

    @Autowired
    private ExtractMonitoringService extractMonitoringService;

    /**
     * 抽取监控列表
     */
    @ApiOperation("抽取监控列表")
    @GetMapping(value = "/list")
    public TableDataInfo getList(QueryExpertExtractMonitorDto dto) {
        startPage();
        List<ExpertExtractionMonitorListVo> list = extractMonitoringService.list(dto);
        return getDataTable(list);
    }
    /**
     *
     * 查询抽取监控
     */
    @ApiOperation("查询抽取监控")
    @GetMapping(value = "/get")
    public ExtractMonitoringAllDto getExpertInfo(@RequestParam(value = "planId",required = false) Long planId,
                                       @RequestParam(value = "proId",required = false)Long proId)
    {
        return extractMonitoringService.getExpertInfo(planId,proId);
    }
    /**
     * 新增抽取监控
     */
    @ApiOperation("新增抽取监控")
    @PostMapping(value = "/add")
    public int add(@Valid @RequestBody ExtractMonitoringAllDto dto)
    {
        return extractMonitoringService.add(dto);
    }
}
